/*
 * @Author: 张小平
 * @Date:   2025-05-01
 * @Email:  qqshuqian@163.com
 * @Copyright © 2024 aseyun. All rights reserved.
 */
import request from '@/framework-core/axios';
import website from '@/framework-core/config/website';




/**
 * 分页查询
 * @param path
 * @param query 查询条件
 */
export function pageForm(query) {

  return request({
    url: website.baseUrl+'/api/form/model/page',
    method: 'post',
    data: query
  })
}


export function saveForm(data,params) {
  return request({
    url: website.baseUrl+'/api/form/model/saveForm',
    method: 'post',
    data: data,
    params: params
  })
}

export function publishForm(params) {
  return request({
    url: website.baseUrl+'/api/form/model/publishForm',
    method: 'post',
    params: params
  })
}

/**
 * 单个查询
 * @param id
 */
export function getFormModel(formId) {
  return request({
    url:website.baseUrl+ '/api/form/model/getFormModel?id=' + formId,
    method: 'get'
  })
}




/**
 * 删除
 * @param row
 */
export function delFormModel(row) {
  return request({
    url: website.baseUrl+'/api/form/model/delete?id=' + row.id,
    method: 'post'
  })
}


/**
 * 导入
 */
export function importFormModel(data,params) {
  return request({
    url:website.baseUrl+ '/api/form/model/import',
    method: 'post',
    data: data,
    params: params
  })
}


/**
 * 导出
 * @param path
 * @param query 查询条件
 */
export function exportFormModel(query) {
  return request({
    url: website.baseUrl+'/api/form/model/export',
    method: 'post',
    params: {}
  })
}

/**
 * 下载
 * @param path
 */
export function downloadCore() {
  return website.baseUrl+'/api/form/model/download'
}


export function saveData(data,params) {
  return request({
    url: website.baseUrl+'/api/form/formData/save',
    method: 'post',
    data: data,
    params: params
  })
}

export function getDataByFormId(formId,dataId) {
  return request({
    url: website.baseUrl+'/api/form/formData/getDataByFormId?formId='+formId+"&id="+dataId,
    method: 'get'
  })
}

export function saveOrders(orders) {
  return request({
    url: website.baseUrl + '/api/order/formOrder/insertBatch',
    method: 'post',
    data:orders
  })
}

export function queryOrders(query) {
  return request({
    url: website.baseUrl+'/api/order/formOrder/query',
    method: 'post',
    data: query
  })
}

